package tech.aistar.day03;

/**
 * 本类用来演示: 奶茶
 *
 * @author: success
 * @date: 2021/3/8 10:20 上午
 */
public class NaiTeaDemo {
    public static void main(String[] args) {
        //定义单价
        double price = 10.0d;

        //定义杯数
        int cup = 5;

        //定义一个总价
        double total = (cup/2)*price + (cup/2)*(price/2);

        //10 5 10 5 10 5 10 5 10
        //判断一下是否为奇数杯
//        if((cup & 1) == 1){
//            total+=price;
        //}
        if((cup & 1) == 1)
            total+=price;
        System.out.println(total);


    }
}
